#ifndef prs_FrmColStyle_H
#define prs_FrmColStyle_H

#include "prs_FrmFunc.h"
#include "prs_FrmRules.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TCol.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmColStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_Col> NodeType;
  TAttrObject<nodeType_Style,frm::control::TCol::TStyle> Style;
  //
  TNodeFrmColStyle() : NodeType(this),Style(this) {}
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmColStyle : public snt::TRule
{
  TRuleFrmColStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmColStyle *GetNode() { return dynamic_cast<TNodeFrmColStyle*>(vParentNode.Pointer());}
  //
  void FNormal  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Normal );}
  void FSelected(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Selected );}
  void FFocused (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Focused );}
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
